package com.linkgie.galaxyframework.httpproxy.converters;

import java.io.InputStream;

import com.linkgie.galaxyframework.httpproxy.HttpServiceContext;
import com.linkgie.galaxyframework.httpproxy.ResponseConverter;
import com.linkgie.galaxyframework.httpproxy.core.ServiceRequest;
import com.linkgie.galaxyframework.utils.BinaryUtils;

public class BinarySerializeResponseConverter implements ResponseConverter {

    @Override
    public Object getResponse(ServiceRequest request, InputStream responseStream, HttpServiceContext serviceContext)
            throws Exception {
    	//TODO: 从安全角度考虑，指定不允许序列化的类型清单；
//    	String[] forbiddenClassNames = {};
//    	return BinaryUtils.deserialize(responseStream, forbiddenClassNames);
    	return BinaryUtils.deserialize(responseStream);
    }

}